#ifndef BUBU_H
#define BUBU_H

#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QPainter>
#include <QMovie>

class Bubu : public QGraphicsItem
{
public:
    //布布的血量
    int hp;
    //布布的攻击伤害
    int atk;
    //布布的移动速度
    int state;
    qreal speed;
    enum { Type = UserType + 2};
    Bubu();
    ~Bubu() override;
    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
    bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode) const override;
    int type() const override;
    void setMovie(QString path);
    void setHead(QString path);

protected:
    QMovie *movie;
    QMovie *head;
};

#endif // BUBU_H
